package feeds;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

public class FeedHelper {

	
	public static String getServiceResult(String url)
	{
		URL serviceURL;
		try {
			serviceURL = new URL(url);
		
			
			URLConnection connect = serviceURL.openConnection();
			
			BufferedReader in = new BufferedReader(
	                new InputStreamReader(
	                		connect.getInputStream()));
			 String inputLine;
			 StringBuffer sb = new StringBuffer();
		        while ((inputLine = in.readLine()) != null) {
		            sb.append(inputLine);
		        }
		        in.close();
	        return sb.toString();
		        
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
}
